package problem;

import tools.Vector;
import uncertainty.UncertaintySet;
import util.Memorier;

public class SingleWareHouseProblem {
	protected UncertaintySet s;
	protected int dim;
	protected int delay;
	protected Memorier mem;
	Vector<Double> c;
	Vector<Double> h;
	Vector<Double> p;
	Vector<Double> m;
	protected double initstock;
	
	public SingleWareHouseProblem(UncertaintySet s, int dim, int delay, Vector<Double> pc, Vector<Double> ph, Vector<Double> pp, Vector<Double> pm, double initst){
		this.s = s;
		this.dim = dim;
		this.initstock = initst;
		this.delay = delay;
		this.mem = new Memorier();
		this.c = pc.copy();
		mem.addDoubleSize(dim);
		this.h = ph.copy();
		mem.addDoubleSize(dim);
		this.p = pp.copy();
		mem.addDoubleSize(dim);
		m = pm;
	}
	
	public UncertaintySet getUncertantySet(){
		return s;
	}
	
	public Vector<Double> getDemandCosts(){
		return (Vector<Double>) c;
	}
	
	public Vector<Double> getStorageCosts(){
		return h;
	}
	
	public double memoryUsedB(){
		double m = mem.getUsedMemB();
		return m;
	}
	
	public double memoryUsedKB(){
		double m = mem.getUsedMemKB();
		return m;
	}
	
	public double memoryUsedMB(){
		double m = mem.getUsedMemMB();
		return m;
	}

	public int getDim() {
		return dim;
	}

	public Vector<Double> getShortageCosts() {
		return p;
	}
	
	public Vector<Double> getLimits() {
		return m;
	}
	
	public void finalize() throws Throwable{
		c = null;
		h = null;
		p = null;
		m = null;
		System.gc();
	}
}
